<?php
	require_once $_SERVER['DOCUMENT_ROOT'] . '/SAGER/logic/CustomCommand.php';	
	require_once $_SERVER['DOCUMENT_ROOT'] . '/SAGER/model/factory/DaoFactory.php';
	require_once $_SERVER['DOCUMENT_ROOT'] . '/SAGER/logic/factory/CommandFactory.php';
	require_once $_SERVER['DOCUMENT_ROOT'] . '/SAGER/model/entity/Measures.php';

	
	error_reporting (E_ALL ^ E_NOTICE);
	
	$debug = $_SESSION['debug'];
	
	/*
	* Command to create Measures
	*/
	class CommandCreateMeasures extends CustomCommand {
		/*
		* Constructor of the class
		*/
		public function __construct($nameMeasures,$numberMeasures, $measuresDate,$filesMeasures) {
			
			/**
			 * Creating pay Installation
			 */
			$this -> measures = new Measures($nameMeasures, $numberMeasures, $measuresDate,$filesMeasures);
				
			
		}
		
		/*
		* Method to execute to create measures
		*/
		public function execute() {
			
			
			/**
			 * Creating a pay measures
			 */
			$daoFactory = DaoFactory :: getMySqlDaoFactory();
			$ibad = $daoFactory -> getMySqlMeasuresAccessDao();
			$GLOBALS['debug']->log("consiguio el Dao measures");
			$measuresCreation = $ibad -> createMeasures($this -> measures);
			$GLOBALS['debug']->log("ejecuto el Dao measures");
		    $GLOBALS['debug']->log("resultado del query: ".$measuresCreation);
			$this -> result = $measuresCreation;
			
		}
	}
?>